package top.kaoshanji.p1ch05d.main;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import top.kaoshanji.p1ch05d.config.ProjectConfig;
import top.kaoshanji.p1ch05d.services.CommentService;

/**
 * 代码清单-p1ch05d-98页d：引用一下延迟加载的bean
 * @author kaoshanji
 * ^_^
 * create time 2025/4/27 20:37
 */
public class Main {

    public static void main(String[] args) {

        var context = new AnnotationConfigApplicationContext(ProjectConfig.class);

        System.out.println("...调用CommentService之前...");

        // 调用一下 CommentService bean
        context.getBean(CommentService.class);

        System.out.println("...调用CommentService之后...");

    }

}
